package com.java.oplog.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;


/**
 * 日志实体信息
 *
 * @author cf
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document("op_log")
public class OpLog {

    /**
     * ID
     */
    @Id
    @Field(name = OPLOGID)
    private String oplogId;

    /**
     * 用户名
     */
    @Field(USERNAME)
    private String username;

    /**
     * 请求IP
     */
    @Field(IP)
    private String ip;

    /**
     * 动作描述
     */
    @Field(DESCRIPTION)
    private String description;

    /**
     * 请求参数
     */
    @Field(PARAMS)
    private String params;

    /**
     * 浏览器
     */
    @Field(BROWSER)
    private String browser;

    /**
     * 创建时间
     */
    @Field(CREATE_TIME)
    private String createTime;

    /**
     * 日志名称
     */
    @Field(TITLE)
    private String title;

    /**
     * 执行方法
     */
    @Field(METHOD)
    private String method;

    /**
     * 请求方式
     */
    @Field(METHOD_TYPE)
    private String methodType;

    /**
     * 执行时间
     */
    @Field(EXEU_TIME)
    private Long exeuTime;

    /**
     * 异常详情
     */
    @Field(EXCEPTION_DETAILS)
    private String exceptionDetails;

    /**
     * 状态
     */
    @Field(STATUS)
    private Integer status;

    public final static String OPLOGID = "_id";
    public final static String USERNAME = "username";
    public final static String IP = "ip";
    public final static String DESCRIPTION = "description";
    public final static String PARAMS = "params";
    public final static String BROWSER = "browser";
    public final static String CREATE_TIME = "create_time";
    public final static String TITLE = "title";
    public final static String METHOD = "method";
    public final static String METHOD_TYPE = "method_type";
    public final static String EXEU_TIME = "exeut_time";
    public final static String EXCEPTION_DETAILS = "exception_details";
    public final static String STATUS = "status";
}
